; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=loop-fusion -S | FileCheck %s
define void @test_long_1() {
; CHECK-LABEL: @test_long_1(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    br i1 true, label [[FOR_BODY6_PREHEADER:%.*]], label [[ENTRY_VECTOR_BODY_CRIT_EDGE:%.*]]
; CHECK:       entry.vector.body_crit_edge:
; CHECK-NEXT:    br label [[VECTOR_BODY:%.*]]
; CHECK:       vector.body:
; CHECK-NEXT:    br i1 true, label [[VECTOR_BODY_FOR_COND_CLEANUP5_CRIT_EDGE:%.*]], label [[VECTOR_BODY]]
; CHECK:       vector.body.for.cond.cleanup5_crit_edge:
; CHECK-NEXT:    br label [[FOR_COND_CLEANUP5:%.*]]
; CHECK:       for.body6.preheader:
; CHECK-NEXT:    br label [[FOR_COND_CLEANUP5]]
; CHECK:       for.cond.cleanup5:
; CHECK-NEXT:    br i1 true, label [[FOR_BODY17_PREHEADER:%.*]], label [[FOR_COND_CLEANUP5_VECTOR_BODY23_CRIT_EDGE:%.*]]
; CHECK:       for.cond.cleanup5.vector.body23_crit_edge:
; CHECK-NEXT:    br label [[VECTOR_BODY23:%.*]]
; CHECK:       vector.body23:
; CHECK-NEXT:    br i1 true, label [[MIDDLE_BLOCK15:%.*]], label [[VECTOR_BODY23]]
; CHECK:       middle.block15:
; CHECK-NEXT:    br label [[ENTRY_VECTOR_BODY_CRIT_EDGE]]
; CHECK:       for.body17.preheader:
; CHECK-NEXT:    unreachable
;
entry:
  br i1 true, label %for.body6.preheader, label %entry.vector.body_crit_edge

entry.vector.body_crit_edge:                      ; preds = %entry
  br label %vector.body

vector.body:                                      ; preds = %entry.vector.body_crit_edge, %vector.body
  br i1 true, label %vector.body.for.cond.cleanup5_crit_edge, label %vector.body

vector.body.for.cond.cleanup5_crit_edge:          ; preds = %vector.body
  br label %for.cond.cleanup5

for.body6.preheader:                              ; preds = %entry
  br label %for.cond.cleanup5

for.cond.cleanup5:                                ; preds = %vector.body.for.cond.cleanup5_crit_edge, %for.body6.preheader
  br i1 true, label %for.body17.preheader, label %for.cond.cleanup5.vector.body23_crit_edge

for.cond.cleanup5.vector.body23_crit_edge:        ; preds = %for.cond.cleanup5
  br label %vector.body23

vector.body23:                                    ; preds = %for.cond.cleanup5.vector.body23_crit_edge, %vector.body23
  br i1 true, label %middle.block15, label %vector.body23

middle.block15:                                   ; preds = %vector.body23
  br label %entry.vector.body_crit_edge

for.body17.preheader:                             ; preds = %for.cond.cleanup5
  unreachable
}
